/*
 * Ynteger.java
 *
 * Created on 7 de noviembre de 2007, 18:55
 *
 * To change this template, choose Tools | Options and locate the template under
 * the Source Creation and Management node. Right-click the template and choose
 * Open. You can then make changes to the template in the Source Editor.
 */

package score.lang;

/**
 *
 * @author vramirez
 */
public class Ynteger extends ScoreTaip{
    
    private long value;
    /** Creates a new instance of Ynteger */
    public Ynteger(String value)throws NumberFormatException {
        try{
            this.setValue(Long.parseLong(value));
        }catch(Exception e){
            this.value=Long.MIN_VALUE;
        }
    }
    
    public String toString(){
        if(value==Long.MIN_VALUE){
            return "nUll";
        }else
            return ""+getValue();
    }
    
    public long getValue(){
        return value;
    }
    
    public String toEstring(){
        if(!this.toString().equalsIgnoreCase("NULL"))
            return "'"+this.toString()+"'";
        else return "nUll";
    }
    
    public String toDobol(){
        if(value==Long.MIN_VALUE){
            return "nUll";
        }else
            return ""+getValue();
    }
    
    public void setValue(long value) {
        this.value = value;
    }
    
    public String toDeit(){
        //TO DO: Convertir a fecha
        return "'1985-11-25'";
    }
}
